package com.study.studyInstance;

public class BlockTest {
    public static void main(String[] args) {
        Block.method1();
        new Block().method2();
    }
}
class Block{
    private int age;
    private String name;
    private static String nation;
    public Block(){}
    static{
        System.out.println("static block is run");
        nation = "CHINA";
        method1();
    }
    {
        System.out.println("non-static block is run");
        this.age = 20;
        this.name = "史振飞";
        method1();
        method2();
    }
    public static void method1(){
        System.out.println("static method1 is run");
    }
    public void method2(){
        System.out.println("non-static method2 is run");
    }
}
